package com.fortune.controller;

import com.fortune.base.BaseAPIExcution;
import com.fortune.base.BaseController;
import com.fortune.dto.excution.WechatProductExcution;
import com.fortune.enums.WechatProductEnum;
import com.fortune.service.PaymentService;
import com.fortune.vo.payment.PaymentInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(value = "wechat/payment", description = "支付相关", tags = {"微信小程序：支付方式（三端通用）"})
@RestController
@RequestMapping("wechat/payment")
public class PaymentController extends BaseController{
	@Autowired
	private PaymentService paymentService;

	@ApiOperation(value = "支付方式列表", nickname = "paymentList", notes = "", tags={ "@郭阳" })
	@ApiImplicitParam(name="Authorization", value="登录返回的token值",paramType="header",dataType="String",required = true)
    @GetMapping(value = "list",
        produces = { MediaType.APPLICATION_JSON_VALUE })
	public BaseAPIExcution<List<PaymentInfo>> list() {
		List<PaymentInfo> list = paymentService.list();
		return new WechatProductExcution<List<PaymentInfo>>(list, WechatProductEnum.FIND_SUCCESS);

	}
}
